package com.sen.Midium;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.Arrays;
import java.util.Collection;

import static org.junit.Assert.assertEquals;

/** Example 1:
* Input: 3
* Output: "III"
*
* Example 2:
* Input: 4
* Output: "IV"
*
* Example 3:
* Input: 9
* Output: "IX"
*
* Example 4:
* Input: 58
* Output: "LVIII"
* Explanation: L = 50, V = 5, III = 3.
*
* Example 5:
* Input: 1994
* Output: "MCMXCIV"
* Explanation: M = 1000, CM = 900, XC = 90 and IV = 4.
*/
@RunWith(Parameterized.class)
public class L012_Integer_To_RomanTest {
    private int num;
    private String output;

    L012_Integer_To_Roman test;

    public L012_Integer_To_RomanTest(int num, String output){
        this.num = num;
        this.output = output;
    }

    @Before
    public void setUp() throws Exception {
        test = new L012_Integer_To_Roman();
    }

    @After
    public void tearDown() throws Exception {
        test = null;
    }

    @Parameterized.Parameters
    public static Collection<Object> run(){
        return Arrays.asList(new Object[][] {
                {3, "III"},
                {4, "IV"},
                {9, "IX"},
                {58, "LVIII"},
                {1994, "MCMXCIV"}

        });
    }

    @Test
    public void testIntToRoman() {
        assertEquals(output, test.intToRoman(num));
    }
}